import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from "axios";
import ElementUI from 'element-ui';
import * as echarts from "echarts"

import 'element-ui/lib/theme-chalk/index.css';
import "bootstrap/dist/css/bootstrap.css"

Vue.config.productionTip = false;

Vue.use(ElementUI);

// 访问后端统一路径
const axiosJSON = axios.create({
  baseURL: 'http://localhost:8080/questionbank',
  headers:{"Access-Control-Allow-Origin":"*"},
  timeout: 2000  
});

const axiosUpload = axios.create({
  baseURL: 'http://localhost:8200/api',
  timeout: 3000,
  headers:{"Access-Control-Allow-Origin":"*","Content-Type":"multipart/form-data"},
});

const axiosForm = axios.create({
  baseURL: 'http://localhost:8200/api',
  timeout: 2000,
  headers:{"Content-Type":"x-www-form-urlencoded"} 
});

//把Axios的对象注册到Vue对象上，挂载到Vue的原型上。
Vue.prototype.axiosJSON =axiosJSON;
Vue.prototype.axiosUpload=axiosUpload;
Vue.prototype.axiosForm=axiosForm;

// 把echarts对象挂载到vue
Vue.prototype.$echarts = echarts


let OAEvent=new Vue();  //声明独立空间, 用于进行事件的发射和响应
Vue.prototype.oaevent=OAEvent 

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
